import request from "@/util/request";

export default {
    // 1. 查询所有书籍
    findAllBooks() {
        return request({
            url: "/book/list",
            method: "get"
        })
    },
    // 2. 分页查询
    findBooksByPage(page,pageSize){
        return request({
            url:`/book/findBooksByPage/${page}/${pageSize}`,
            method:"get"
        })
    },
// 3. 条件查询
    searchBook(page, pageSize, data) {
        return request({
            url: `/book/searchBook/${page}/${pageSize}`,
            method: "post",
            data
        })
    },
    //4保存书籍
    saveBook(url,method,data){
        return request({
            url,
            method,
            data
        })
    },
    //5删除书籍
    delete(ids){
        return request({
            url:`/book/delete/${ids}`,
            method:"delete"
        })
    },
}
